package c.e.a.b.f.b;

import android.content.ServiceConnection;
import c.e.a.b.e.c.e2;

/* compiled from: com.google.android.gms:play-services-measurement-impl@@18.0.0 */
public final class o4 implements Runnable {
    public final /* synthetic */ e2 a;
    public final /* synthetic */ ServiceConnection b;
    public final /* synthetic */ l4 c;

    public o4(l4 l4Var, e2 e2Var, ServiceConnection serviceConnection) {
        this.c = l4Var;
        this.a = e2Var;
        this.b = serviceConnection;
    }

    /* JADX WARNING: Removed duplicated region for block: B:13:0x005f  */
    /* JADX WARNING: Removed duplicated region for block: B:54:? A:{SYNTHETIC, RETURN} */
    /* JADX WARNING: Removed duplicated region for block: B:52:0x0185  */
    public final void run() {
        /*
        r13 = this;
        r0 = r13.c;
        r1 = r0.b;
        r0 = r0.a;
        r2 = r13.a;
        r3 = r13.b;
        r4 = r1.a;
        r4 = r4.a();
        r4.g();
        if (r2 != 0) goto L_0x0023;
    L_0x0015:
        r0 = r1.a;
        r0 = r0.d();
        r0 = r0.i;
        r2 = "Attempting to use Install Referrer Service while it is not initialized";
        r0.a(r2);
        goto L_0x0053;
    L_0x0023:
        r4 = new android.os.Bundle;
        r4.<init>();
        r5 = "package_name";
        r4.putString(r5, r0);
        r0 = r2.p(r4);	 Catch:{ Exception -> 0x0041 }
        if (r0 != 0) goto L_0x0054;
    L_0x0033:
        r0 = r1.a;	 Catch:{ Exception -> 0x0041 }
        r0 = r0.d();	 Catch:{ Exception -> 0x0041 }
        r0 = r0.f;	 Catch:{ Exception -> 0x0041 }
        r2 = "Install Referrer Service returned a null response";
        r0.a(r2);	 Catch:{ Exception -> 0x0041 }
        goto L_0x0053;
    L_0x0041:
        r0 = move-exception;
        r2 = r1.a;
        r2 = r2.d();
        r2 = r2.f;
        r0 = r0.getMessage();
        r4 = "Exception occurred while retrieving the Install Referrer";
        r2.b(r4, r0);
    L_0x0053:
        r0 = 0;
    L_0x0054:
        r2 = r1.a;
        r2 = r2.a();
        r2.g();
        if (r0 == 0) goto L_0x0183;
    L_0x005f:
        r4 = 0;
        r2 = "install_begin_timestamp_seconds";
        r6 = r0.getLong(r2, r4);
        r8 = 1000; // 0x3e8 float:1.401E-42 double:4.94E-321;
        r6 = r6 * r8;
        r2 = (r6 > r4 ? 1 : (r6 == r4 ? 0 : -1));
        if (r2 != 0) goto L_0x007e;
    L_0x006f:
        r0 = r1.a;
        r0 = r0.d();
        r0 = r0.i;
        r2 = "Service response is missing Install Referrer install timestamp";
        r0.a(r2);
        goto L_0x0183;
    L_0x007e:
        r2 = "install_referrer";
        r2 = r0.getString(r2);
        if (r2 == 0) goto L_0x0176;
    L_0x0086:
        r10 = r2.isEmpty();
        if (r10 == 0) goto L_0x008e;
    L_0x008c:
        goto L_0x0176;
    L_0x008e:
        r10 = r1.a;
        r10 = r10.d();
        r10 = r10.n;
        r11 = "InstallReferrer API result";
        r10.b(r11, r2);
        r10 = r1.a;
        r10 = r10.t();
        r11 = "?";
        r12 = r2.length();
        if (r12 == 0) goto L_0x00ae;
    L_0x00a9:
        r2 = r11.concat(r2);
        goto L_0x00b3;
    L_0x00ae:
        r2 = new java.lang.String;
        r2.<init>(r11);
    L_0x00b3:
        r2 = android.net.Uri.parse(r2);
        r2 = r10.x(r2);
        if (r2 != 0) goto L_0x00cc;
    L_0x00bd:
        r0 = r1.a;
        r0 = r0.d();
        r0 = r0.f;
        r2 = "No campaign params defined in Install Referrer result";
        r0.a(r2);
        goto L_0x0183;
    L_0x00cc:
        r10 = "medium";
        r10 = r2.getString(r10);
        if (r10 == 0) goto L_0x00e6;
    L_0x00d4:
        r11 = "(not set)";
        r11 = r11.equalsIgnoreCase(r10);
        if (r11 != 0) goto L_0x00e6;
    L_0x00dc:
        r11 = "organic";
        r10 = r11.equalsIgnoreCase(r10);
        if (r10 != 0) goto L_0x00e6;
    L_0x00e4:
        r10 = 1;
        goto L_0x00e7;
    L_0x00e6:
        r10 = 0;
    L_0x00e7:
        if (r10 == 0) goto L_0x0109;
    L_0x00e9:
        r10 = "referrer_click_timestamp_seconds";
        r10 = r0.getLong(r10, r4);
        r10 = r10 * r8;
        r0 = (r10 > r4 ? 1 : (r10 == r4 ? 0 : -1));
        if (r0 != 0) goto L_0x0104;
    L_0x00f5:
        r0 = r1.a;
        r0 = r0.d();
        r0 = r0.f;
        r2 = "Install Referrer is missing click timestamp for ad campaign";
        r0.a(r2);
        goto L_0x0183;
    L_0x0104:
        r0 = "click_timestamp";
        r2.putLong(r0, r10);
    L_0x0109:
        r0 = r1.a;
        r0 = r0.o();
        r0 = r0.k;
        r4 = r0.a();
        r0 = (r6 > r4 ? 1 : (r6 == r4 ? 0 : -1));
        if (r0 != 0) goto L_0x0127;
    L_0x0119:
        r0 = r1.a;
        r0 = r0.d();
        r0 = r0.n;
        r2 = "Install Referrer campaign has already been logged";
        r0.a(r2);
        goto L_0x0183;
    L_0x0127:
        r0 = c.e.a.b.e.c.i9.b;
        r0 = r0.q();
        r0 = (c.e.a.b.e.c.l9) r0;
        r0 = r0.q();
        if (r0 == 0) goto L_0x0149;
    L_0x0135:
        r0 = r1.a;
        r0 = r0.g;
        r4 = c.e.a.b.f.b.p.t0;
        r0 = r0.o(r4);
        if (r0 == 0) goto L_0x0149;
    L_0x0141:
        r0 = r1.a;
        r0 = r0.i();
        if (r0 == 0) goto L_0x0183;
    L_0x0149:
        r0 = r1.a;
        r0 = r0.o();
        r0 = r0.k;
        r0.b(r6);
        r0 = r1.a;
        r0 = r0.d();
        r0 = r0.n;
        r4 = "referrer API";
        r5 = "Logging Install Referrer campaign from sdk with ";
        r0.b(r5, r4);
        r0 = "_cis";
        r2.putString(r0, r4);
        r0 = r1.a;
        r0 = r0.s();
        r4 = "auto";
        r5 = "_cmp";
        r0.H(r4, r5, r2);
        goto L_0x0183;
    L_0x0176:
        r0 = r1.a;
        r0 = r0.d();
        r0 = r0.f;
        r2 = "No referrer defined in Install Referrer response";
        r0.a(r2);
    L_0x0183:
        if (r3 == 0) goto L_0x0193;
    L_0x0185:
        r0 = c.e.a.b.b.i.a.a();
        r1 = r1.a;
        r1 = r1.a;
        java.util.Objects.requireNonNull(r0);
        r1.unbindService(r3);
    L_0x0193:
        return;
        */
        throw new UnsupportedOperationException("Method not decompiled: c.e.a.b.f.b.o4.run():void");
    }
}
